# L = ['', '独身数', '', '水仙花数', '独四叶玫瑰数', '五角星数',
#     '六合数', '北斗七星数', '八仙数', '九九重阳数', '十全十美数']
# print(L[len(s)])



# m = int(input('请输入起点：'))
# n = int(input('请输入终点：'))
# for i in range(m,n+1):
while 1:
    i = int(input('请输入要判断的一个数：'))
    w = ''
    if i % 2 != 0:
        w += '奇'
    else:
        w += '偶'

    for j in range(2, i):
        if i % j == 0:
            w += '合数'
            break
    else:
        w += '质数'

    s = str(i)
    sum = 0
    for k in s:
        sum += int(k)**len(s)
    if sum == int(s):
        w += ',自幂数'
    print(s+'是'+w)

    

# while 1:
# i = int(input('请输入要判断的一个数：'))
# if i % 2 != 0:
#     print(i, '是奇数')
# else:
#     print(i, '是偶数')

# for j in range(2, i):
#     if i % j == 0:
#         print(i, '是合数')
#         break
# else:
#     print(i, '是质数')

# s = str(i)
# sum = 0
# for k in s:
#     sum += int(k)**len(s)
# if sum == int(s):
#     print(i, '是自幂数')



